Adobe® Flash® Platform 用 ActionScript® 3.0 リファレンスガイド
ホーム  |  パッケージおよびクラスリストの非表示 |  パッケージ  |  クラス  |  新機能  |  索引  |  付録  |  英語で表示される理由
フィルター: AIR 30.0 以前, Flash Player 30.0 以前, Flash Lite 4
Flex 4.6 以前, Flash Pro CS6 以前
フィルターを非表示
flash.globalization 

DateTimeFormatter  - AS3

パッケージx

トップレベル
adobe.utils
air.desktop
air.net
air.update
air.update.events
coldfusion.air
coldfusion.air.errors
coldfusion.air.events
coldfusion.service
coldfusion.service.events
coldfusion.service.mxml
com.adobe.acm.solutions.authoring.domain.extensions
com.adobe.acm.solutions.ccr.domain.extensions
com.adobe.consulting.pst.vo
com.adobe.dct.component
com.adobe.dct.component.datadictionary
com.adobe.dct.component.datadictionaryElement
com.adobe.dct.component.dataElementsPanel
com.adobe.dct.component.toolbars
com.adobe.dct.event
com.adobe.dct.exp
com.adobe.dct.model
com.adobe.dct.service
com.adobe.dct.service.provider
com.adobe.dct.transfer
com.adobe.dct.util
com.adobe.dct.view
com.adobe.ep.taskmanagement.domain
com.adobe.ep.taskmanagement.event
com.adobe.ep.taskmanagement.filter
com.adobe.ep.taskmanagement.services
com.adobe.ep.taskmanagement.util
com.adobe.ep.ux.attachmentlist.component
com.adobe.ep.ux.attachmentlist.domain
com.adobe.ep.ux.attachmentlist.domain.events
com.adobe.ep.ux.attachmentlist.domain.renderers
com.adobe.ep.ux.attachmentlist.skin
com.adobe.ep.ux.attachmentlist.skin.renderers
com.adobe.ep.ux.content.event
com.adobe.ep.ux.content.factory
com.adobe.ep.ux.content.handlers
com.adobe.ep.ux.content.managers
com.adobe.ep.ux.content.model.asset
com.adobe.ep.ux.content.model.preview
com.adobe.ep.ux.content.model.relation
com.adobe.ep.ux.content.model.search
com.adobe.ep.ux.content.model.toolbar
com.adobe.ep.ux.content.search
com.adobe.ep.ux.content.services
com.adobe.ep.ux.content.services.load
com.adobe.ep.ux.content.services.permissions
com.adobe.ep.ux.content.services.preview
com.adobe.ep.ux.content.services.providers
com.adobe.ep.ux.content.services.query
com.adobe.ep.ux.content.services.relationships
com.adobe.ep.ux.content.services.search.lccontent
com.adobe.ep.ux.content.services.version
com.adobe.ep.ux.content.view
com.adobe.ep.ux.content.view.components.activate
com.adobe.ep.ux.content.view.components.grid
com.adobe.ep.ux.content.view.components.grid.hover
com.adobe.ep.ux.content.view.components.grid.hover.component
com.adobe.ep.ux.content.view.components.grid.renderers
com.adobe.ep.ux.content.view.components.relationships
com.adobe.ep.ux.content.view.components.review
com.adobe.ep.ux.content.view.components.search.renderers
com.adobe.ep.ux.content.view.components.searchpod
com.adobe.ep.ux.content.view.components.toolbar
com.adobe.ep.ux.content.view.components.toolbar.controlRenderers
com.adobe.ep.ux.content.view.components.version
com.adobe.ep.ux.documentsubmit.component
com.adobe.ep.ux.documentsubmit.domain
com.adobe.ep.ux.documentsubmit.skin
com.adobe.ep.ux.taskaction.component
com.adobe.ep.ux.taskaction.domain
com.adobe.ep.ux.taskaction.domain.events
com.adobe.ep.ux.taskaction.skin
com.adobe.ep.ux.taskdetails.component
com.adobe.ep.ux.taskdetails.domain
com.adobe.ep.ux.taskdetails.skin
com.adobe.ep.ux.tasklist.component
com.adobe.ep.ux.tasklist.domain
com.adobe.ep.ux.tasklist.skin
com.adobe.ep.ux.webdocumentviewer.domain
com.adobe.exm.expression
com.adobe.exm.expression.error
com.adobe.exm.expression.event
com.adobe.exm.expression.impl
com.adobe.fiber.runtime.lib
com.adobe.fiber.services
com.adobe.fiber.services.wrapper
com.adobe.fiber.styles
com.adobe.fiber.util
com.adobe.fiber.valueobjects
com.adobe.gravity.binding
com.adobe.gravity.context
com.adobe.gravity.flex.bundleloader
com.adobe.gravity.flex.progress
com.adobe.gravity.flex.serviceloader
com.adobe.gravity.framework
com.adobe.gravity.init
com.adobe.gravity.service.bundleloader
com.adobe.gravity.service.logging
com.adobe.gravity.service.manifest
com.adobe.gravity.service.progress
com.adobe.gravity.tracker
com.adobe.gravity.ui
com.adobe.gravity.utility
com.adobe.gravity.utility.async
com.adobe.gravity.utility.error
com.adobe.gravity.utility.events
com.adobe.gravity.utility.factory
com.adobe.gravity.utility.flex.async
com.adobe.gravity.utility.logging
com.adobe.gravity.utility.message
com.adobe.gravity.utility.sequence
com.adobe.gravity.utility.url
com.adobe.guides.control
com.adobe.guides.domain
com.adobe.guides.i18n
com.adobe.guides.spark.components.skins
com.adobe.guides.spark.components.skins.mx
com.adobe.guides.spark.headers.components
com.adobe.guides.spark.headers.skins
com.adobe.guides.spark.layouts.components
com.adobe.guides.spark.layouts.skins
com.adobe.guides.spark.navigators.components
com.adobe.guides.spark.navigators.renderers
com.adobe.guides.spark.navigators.skins
com.adobe.guides.spark.util
com.adobe.guides.spark.wrappers.components
com.adobe.guides.spark.wrappers.skins
com.adobe.guides.submit
com.adobe.icc.dc.domain
com.adobe.icc.dc.domain.factory
com.adobe.icc.editors.events
com.adobe.icc.editors.handlers
com.adobe.icc.editors.managers
com.adobe.icc.editors.model
com.adobe.icc.editors.model.config
com.adobe.icc.editors.model.el
com.adobe.icc.editors.model.el.operands
com.adobe.icc.editors.model.el.operators
com.adobe.icc.enum
com.adobe.icc.external.dc
com.adobe.icc.obj
com.adobe.icc.services
com.adobe.icc.services.category
com.adobe.icc.services.config
com.adobe.icc.services.download
com.adobe.icc.services.export
com.adobe.icc.services.external
com.adobe.icc.services.formbridge
com.adobe.icc.services.fragmentlayout
com.adobe.icc.services.layout
com.adobe.icc.services.letter
com.adobe.icc.services.locator
com.adobe.icc.services.module
com.adobe.icc.services.render
com.adobe.icc.services.submit
com.adobe.icc.services.user
com.adobe.icc.token
com.adobe.icc.vo
com.adobe.icc.vo.render
com.adobe.icomm.assetplacement.controller
com.adobe.icomm.assetplacement.controller.utils
com.adobe.icomm.assetplacement.data
com.adobe.icomm.assetplacement.model
com.adobe.livecycle.assetmanager.client
com.adobe.livecycle.assetmanager.client.event
com.adobe.livecycle.assetmanager.client.handler
com.adobe.livecycle.assetmanager.client.managers
com.adobe.livecycle.assetmanager.client.model
com.adobe.livecycle.assetmanager.client.model.cms
com.adobe.livecycle.assetmanager.client.service
com.adobe.livecycle.assetmanager.client.service.search
com.adobe.livecycle.assetmanager.client.service.search.cms
com.adobe.livecycle.assetmanager.client.utils
com.adobe.livecycle.content
com.adobe.livecycle.rca.model
com.adobe.livecycle.rca.model.constant
com.adobe.livecycle.rca.model.document
com.adobe.livecycle.rca.model.participant
com.adobe.livecycle.rca.model.reminder
com.adobe.livecycle.rca.model.stage
com.adobe.livecycle.rca.service
com.adobe.livecycle.rca.service.core
com.adobe.livecycle.rca.service.core.delegate
com.adobe.livecycle.rca.service.process
com.adobe.livecycle.rca.service.process.delegate
com.adobe.livecycle.rca.token
com.adobe.livecycle.ria.security.api
com.adobe.livecycle.ria.security.service
com.adobe.mosaic.layouts
com.adobe.mosaic.layouts.dragAndDrop
com.adobe.mosaic.layouts.interfaces
com.adobe.mosaic.mxml
com.adobe.mosaic.om.constants
com.adobe.mosaic.om.events
com.adobe.mosaic.om.impl
com.adobe.mosaic.om.interfaces
com.adobe.mosaic.skinning
com.adobe.mosaic.sparklib.editors
com.adobe.mosaic.sparklib.optionMenu
com.adobe.mosaic.sparklib.scrollableMenu
com.adobe.mosaic.sparklib.scrollableMenu.skins
com.adobe.mosaic.sparklib.tabLayout
com.adobe.mosaic.sparklib.tabLayout.events
com.adobe.mosaic.sparklib.tabLayout.layouts
com.adobe.mosaic.sparklib.tabLayout.skins
com.adobe.mosaic.sparklib.text
com.adobe.mosaic.sparklib.util
com.adobe.solutions.acm.authoring.presentation
com.adobe.solutions.acm.authoring.presentation.actionbar
com.adobe.solutions.acm.authoring.presentation.common
com.adobe.solutions.acm.authoring.presentation.events
com.adobe.solutions.acm.authoring.presentation.fragment
com.adobe.solutions.acm.authoring.presentation.letter
com.adobe.solutions.acm.authoring.presentation.letter.data
com.adobe.solutions.acm.authoring.presentation.preview
com.adobe.solutions.acm.authoring.presentation.rte
com.adobe.solutions.acm.ccr.presentation
com.adobe.solutions.acm.ccr.presentation.contentcapture
com.adobe.solutions.acm.ccr.presentation.contentcapture.events
com.adobe.solutions.acm.ccr.presentation.contentcapture.preview
com.adobe.solutions.acm.ccr.presentation.datacapture
com.adobe.solutions.acm.ccr.presentation.datacapture.renderers
com.adobe.solutions.acm.ccr.presentation.pdf
com.adobe.solutions.exm
com.adobe.solutions.exm.authoring
com.adobe.solutions.exm.authoring.components.controls
com.adobe.solutions.exm.authoring.components.toolbars
com.adobe.solutions.exm.authoring.domain
com.adobe.solutions.exm.authoring.domain.expression
com.adobe.solutions.exm.authoring.domain.impl
com.adobe.solutions.exm.authoring.domain.method
com.adobe.solutions.exm.authoring.domain.variable
com.adobe.solutions.exm.authoring.enum
com.adobe.solutions.exm.authoring.events
com.adobe.solutions.exm.authoring.model
com.adobe.solutions.exm.authoring.renderer
com.adobe.solutions.exm.authoring.view
com.adobe.solutions.exm.expression
com.adobe.solutions.exm.impl
com.adobe.solutions.exm.impl.method
com.adobe.solutions.exm.method
com.adobe.solutions.exm.mock
com.adobe.solutions.exm.mock.method
com.adobe.solutions.exm.runtime
com.adobe.solutions.exm.runtime.impl
com.adobe.solutions.exm.variable
com.adobe.solutions.prm.constant
com.adobe.solutions.prm.domain
com.adobe.solutions.prm.domain.factory
com.adobe.solutions.prm.domain.impl
com.adobe.solutions.prm.domain.manager
com.adobe.solutions.prm.presentation.asset
com.adobe.solutions.prm.presentation.constant
com.adobe.solutions.prm.presentation.document
com.adobe.solutions.prm.presentation.event
com.adobe.solutions.prm.presentation.file
com.adobe.solutions.prm.presentation.project
com.adobe.solutions.prm.presentation.team
com.adobe.solutions.prm.presentation.util
com.adobe.solutions.prm.service
com.adobe.solutions.prm.services.impl
com.adobe.solutions.prm.vo
com.adobe.solutions.rca.constant
com.adobe.solutions.rca.domain
com.adobe.solutions.rca.domain.common
com.adobe.solutions.rca.domain.factory
com.adobe.solutions.rca.domain.impl
com.adobe.solutions.rca.domain.impl.manager
com.adobe.solutions.rca.domain.manager
com.adobe.solutions.rca.presentation
com.adobe.solutions.rca.presentation.comment
com.adobe.solutions.rca.presentation.constant
com.adobe.solutions.rca.presentation.event
com.adobe.solutions.rca.presentation.gantt
com.adobe.solutions.rca.presentation.gantt.ruler
com.adobe.solutions.rca.presentation.template
com.adobe.solutions.rca.presentation.template.audit
com.adobe.solutions.rca.presentation.template.definition
com.adobe.solutions.rca.presentation.template.documents
com.adobe.solutions.rca.presentation.template.stages
com.adobe.solutions.rca.presentation.util
com.adobe.solutions.rca.service
com.adobe.solutions.rca.services.impl
com.adobe.solutions.rca.vo
com.adobe.solutions.rca.vo.um
com.adobe.viewsource
fl.accessibility
fl.containers
fl.controls
fl.controls.dataGridClasses
fl.controls.listClasses
fl.controls.progressBarClasses
fl.core
fl.data
fl.display
fl.events
fl.ik
fl.lang
fl.livepreview
fl.managers
fl.motion
fl.motion.easing
fl.rsl
fl.text
fl.transitions
fl.transitions.easing
fl.video
flash.accessibility
flash.concurrent
flash.crypto
flash.data
flash.desktop
flash.display
flash.display3D
flash.display3D.textures
flash.errors
flash.events
flash.external
flash.filesystem
flash.filters
flash.geom
flash.globalization
flash.html
flash.media
flash.net
flash.net.dns
flash.net.drm
flash.notifications
flash.permissions
flash.printing
flash.profiler
flash.sampler
flash.security
flash.sensors
flash.system
flash.text
flash.text.engine
flash.text.ime
flash.ui
flash.utils
flash.xml
flashx.textLayout
flashx.textLayout.compose
flashx.textLayout.container
flashx.textLayout.conversion
flashx.textLayout.edit
flashx.textLayout.elements
flashx.textLayout.events
flashx.textLayout.factory
flashx.textLayout.formats
flashx.textLayout.operations
flashx.textLayout.utils
flashx.undo
ga.controls
ga.layouts
ga.model
ga.uiComponents
ga.util
ga.views
ga.wrappers
lc.foundation
lc.foundation.domain
lc.foundation.events
lc.foundation.ui
lc.foundation.util
lc.preloader
lc.procmgmt
lc.procmgmt.commands
lc.procmgmt.domain
lc.procmgmt.events
lc.procmgmt.formbridge
lc.procmgmt.impl
lc.procmgmt.ui.attachments
lc.procmgmt.ui.controls
lc.procmgmt.ui.controls.card
lc.procmgmt.ui.controls.renderer
lc.procmgmt.ui.help
lc.procmgmt.ui.layout
lc.procmgmt.ui.presentationmodel
lc.procmgmt.ui.process
lc.procmgmt.ui.search
lc.procmgmt.ui.startpoint
lc.procmgmt.ui.task
lc.procmgmt.ui.task.form
lc.procmgmt.ui.task.form.commands
lc.procmgmt.ui.tracking
mx.accessibility
mx.automation
mx.automation.air
mx.automation.delegates
mx.automation.delegates.advancedDataGrid
mx.automation.delegates.charts
mx.automation.delegates.containers
mx.automation.delegates.controls
mx.automation.delegates.controls.dataGridClasses
mx.automation.delegates.controls.fileSystemClasses
mx.automation.delegates.core
mx.automation.delegates.flashflexkit
mx.automation.events
mx.binding
mx.binding.utils
mx.charts
mx.charts.chartClasses
mx.charts.effects
mx.charts.effects.effectClasses
mx.charts.events
mx.charts.renderers
mx.charts.series
mx.charts.series.items
mx.charts.series.renderData
mx.charts.styles
mx.collections
mx.collections.errors
mx.containers
mx.containers.accordionClasses
mx.containers.dividedBoxClasses
mx.containers.errors
mx.containers.utilityClasses
mx.controls
mx.controls.advancedDataGridClasses
mx.controls.dataGridClasses
mx.controls.listClasses
mx.controls.menuClasses
mx.controls.olapDataGridClasses
mx.controls.scrollClasses
mx.controls.sliderClasses
mx.controls.textClasses
mx.controls.treeClasses
mx.controls.videoClasses
mx.core
mx.core.windowClasses
mx.data
mx.data.crypto
mx.data.errors
mx.data.events
mx.data.messages
mx.data.mxml
mx.data.offline.errors
mx.data.utils
mx.effects
mx.effects.easing
mx.effects.effectClasses
mx.events
mx.filters
mx.flash
mx.formatters
mx.geom
mx.graphics
mx.graphics.codec
mx.graphics.shaderClasses
mx.logging
mx.logging.errors
mx.logging.targets
mx.managers
mx.messaging
mx.messaging.channels
mx.messaging.config
mx.messaging.errors
mx.messaging.events
mx.messaging.management
mx.messaging.messages
mx.modules
mx.netmon
mx.olap
mx.olap.aggregators
mx.preloaders
mx.printing
mx.resources
mx.rpc
mx.rpc.events
mx.rpc.http
mx.rpc.http.mxml
mx.rpc.livecycle
mx.rpc.mxml
mx.rpc.remoting
mx.rpc.remoting.mxml
mx.rpc.soap
mx.rpc.soap.mxml
mx.rpc.wsdl
mx.rpc.xml
mx.skins
mx.skins.halo
mx.skins.spark
mx.skins.wireframe
mx.skins.wireframe.windowChrome
mx.states
mx.styles
mx.utils
mx.validators
org.osmf.containers
org.osmf.display
org.osmf.elements
org.osmf.events
org.osmf.layout
org.osmf.logging
org.osmf.media
org.osmf.metadata
org.osmf.net
org.osmf.net.dvr
org.osmf.net.httpstreaming
org.osmf.net.metrics
org.osmf.net.qos
org.osmf.net.rtmpstreaming
org.osmf.net.rules
org.osmf.traits
org.osmf.utils
spark.accessibility
spark.automation.delegates
spark.automation.delegates.components
spark.automation.delegates.components.gridClasses
spark.automation.delegates.components.mediaClasses
spark.automation.delegates.components.supportClasses
spark.automation.delegates.skins.spark
spark.automation.events
spark.collections
spark.components
spark.components.calendarClasses
spark.components.gridClasses
spark.components.mediaClasses
spark.components.supportClasses
spark.components.windowClasses
spark.core
spark.effects
spark.effects.animation
spark.effects.easing
spark.effects.interpolation
spark.effects.supportClasses
spark.events
spark.filters
spark.formatters
spark.formatters.supportClasses
spark.globalization
spark.globalization.supportClasses
spark.layouts
spark.layouts.supportClasses
spark.managers
spark.modules
spark.preloaders
spark.primitives
spark.primitives.supportClasses
spark.skins
spark.skins.mobile
spark.skins.mobile.supportClasses
spark.skins.spark
spark.skins.spark.mediaClasses.fullScreen
spark.skins.spark.mediaClasses.normal
spark.skins.spark.windowChrome
spark.skins.wireframe
spark.skins.wireframe.mediaClasses
spark.skins.wireframe.mediaClasses.fullScreen
spark.transitions
spark.utils
spark.validators
spark.validators.supportClasses
xd.core.axm.enterprise.view.components
xd.core.axm.enterprise.view.skins
xd.core.axm.view.components
xd.core.axm.view.components.support

言語エレメント

グローバル定数
グローバル関数
演算子
ステートメント、キーワード、ディレクティブ
特殊な型

付録

新機能
コンパイルエラー
コンパイラー警告
ランタイムエラー
ActionScript 3 への移行
サポートされている文字セット
MXML のみのタグ
モーション XML エレメント
Timed Text タグ
使用されなくなったエレメントのリスト
Accessibility Implementation 定数
ActionScript の例の使用方法
法律上の注意
パッケージflash.globalization
クラスpublic final class DateTimeFormatter
継承DateTimeFormatter Inheritance Object

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

DateTimeFormatter クラスは、日付オブジェクトのロケールに依存したフォーマット、およびローカライズされた日付フィールド名へのアクセスを可能にします。このクラスのメソッドは、オペレーティングシステムによって提供される関数と設定を使用します。

日付および時刻フォーマットを選択するには、事前定義のパターンを使用する方法とカスタムパターンを使用する方法の 2 種類の方法があります。 ほとんどの用途で、DateTimeStyle 定数(LONGMEDIUMNONE、または SHORT)で指定された事前定義のスタイルを使用します。これらの定数により、要求されたロケールのデフォルトパターンまたはユーザーのオペレーティングシステムに基づくデフォルトパターンが指定されます。

例えば、次のコードにより、デフォルトの短い日付フォーマットを使用して、日付文字列が作成されます。

 
     var df:DateTimeFormatter = new DateTimeFormatter(LocaleID.DEFAULT, DateTimeStyle.SHORT, DateTimeStyle.NONE);
     var currentDate:Date = new Date();
     var shortDate:String = df.format(currentDate);
     

このクラスのインスタンスが作成されると、要求されたロケールがオペレーティングシステムでサポートされている場合、要求されたロケールおよびコンストラクターの dateStyletimeStyle パラメーターの規則やデフォルトに基づいて、インスタンスのプロパティが設定されます。要求されたロケールを使用できない場合、プロパティは actualLocaleIDName プロパティを使用して取得できる代替またはデフォルトのシステムロケールに基づいて設定されます。

このクラスには、月の名前および曜日の名前のローカライズされた文字列を取得し、カレンダーピッカーやその他の同様のアプリケーションで使用できる週の最初の日を取得する追加のメソッドが含まれています。

ユーザー設定の使用、オペレーティングシステムによって提供されるフォーマットパターンの使用および要求したロケールがサポートされてない場合の代替ロケールの使用が原因となり、同じロケール ID を使用していても、ユーザーによって表示されるフォーマット結果が異なる場合があります。

例を表示

関連する API エレメント



パブリックプロパティ
 プロパティ定義元
  actualLocaleIDName : String
[読み取り専用] この DateTimeFormatter オブジェクトで使用される実際のロケール ID の名前。
DateTimeFormatter
 Inheritedconstructor : Object
指定されたオブジェクトインスタンスのクラスオブジェクトまたはコンストラクター関数への参照です。
Object
  lastOperationStatus : String
[読み取り専用] この DateTimeFormatter オブジェクトが実行した前の操作のステータス。
DateTimeFormatter
  requestedLocaleIDName : String
[読み取り専用] この DateTimeFormatter オブジェクトのコンストラクターに渡された、要求されたロケール ID の名前。
DateTimeFormatter
パブリックメソッド
 メソッド定義元
  
DateTimeFormatter(requestedLocaleIDName:String, dateStyle:String = "long", timeStyle:String = "long")
指定されたロケールと提供された日付と時刻フォーマットスタイルの規則に基づいて、日付と時間をフォーマットするための新しい DateTimeFormatter オブジェクトを構築します。
DateTimeFormatter
  
format(dateTime:Date):String
ユーザーのローカル時間として解釈される(date、day、fullYear、hours、minutes、month および seconds などの Date オブジェクトのローカル時間コンポーネントを使用)Date オブジェクトの表示文字列をフォーマットします。
DateTimeFormatter
  
UTC 時間として解釈される(dateUTC、dayUTC、fullYearUTC、hoursUTC、minutesUTC、monthUTC および secondsUTC などの Date オブジェクトの UTC コンポーネントを使用)Date オブジェクトの表示文字列を dateStyle、timeStyle 、または日付時刻パターンに基づいてフォーマットします。
DateTimeFormatter
  
[静的] このクラスでサポートされているすべてのロケール ID 名のリストが表示されます。
DateTimeFormatter
  
DateTimeFormatter のこのインスタンスの日付スタイルを取得します。
DateTimeFormatter
  
この DateTimeFormatter オブジェクトによって日付と時間をフォーマットするために使用されるパターン文字列を返します。
DateTimeFormatter
  
このロケールおよびカレンダーシステムの週の最初の日に対応する整数を返します。
DateTimeFormatter
  
getMonthNames(nameStyle:String = "full", context:String = "standalone"):Vector.<String>
現在のカレンダーシステムの月の名前を含むローカライズされた文字列のリストを取得します。
DateTimeFormatter
  
DateTimeFormatter のこのインスタンスの時間スタイルを取得します。
DateTimeFormatter
  
getWeekdayNames(nameStyle:String = "full", context:String = "standalone"):Vector.<String>
現在のカレンダーシステムの曜日の名前を含むローカライズされた文字列のリストを取得します。
DateTimeFormatter
 Inherited
オブジェクトに指定されたプロパティが定義されているかどうかを示します。
Object
 Inherited
Object クラスのインスタンスが、パラメーターとして指定されたオブジェクトのプロトタイプチェーン内にあるかどうかを示します。
Object
 Inherited
指定されたプロパティが存在し、列挙できるかどうかを示します。
Object
  
この DateTimeFormatter オブジェクトで日付と時間をフォーマットするために使用するパターン文字列を設定します。
DateTimeFormatter
  
setDateTimeStyles(dateStyle:String, timeStyle:String):void
DateTimeFormatter のこのインスタンスの日付および時刻スタイルを設定します。
DateTimeFormatter
 Inherited
ループ処理に対するダイナミックプロパティの可用性を設定します。
Object
 Inherited
ロケール固有の規則に従って書式設定された、このオブジェクトのストリング表現を返します。
Object
 Inherited
指定されたオブジェクトのストリング表現を返します。
Object
 Inherited
指定されたオブジェクトのプリミティブな値を返します。
Object
プロパティの詳細

actualLocaleIDName

プロパティ
actualLocaleIDName:String  [読み取り専用]

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

この DateTimeFormatter オブジェクトで使用される実際のロケール ID の名前。

オペレーティングシステムおよび Collator() コンストラクターに渡される requestedLocaleIDName パラメーターの値に応じて、この名前の値には 3 つの可能性があります。

  1. 要求されたロケールが LocaleID.DEFAULT ではなく、要求されたロケールをオペレーティングシステムがサポートする場合、返される名前は requestedLocaleIDName プロパティと同じです。
  2. LocaleID.DEFAULT がコンストラクターに対する requestedLocaleIDName パラメーターの値として使用された場合、ユーザーのオペレーティングシステムによって指定された現在のロケールの名前が使用されます。LocaleID.DEFAULT 値により、ユーザーのカスタマイズした設定が OS に保持されます。requestedLocaleIDName パラメーターとして明示的な値を渡した場合に、2 つのロケール ID 名が同じでも LocaleID.DEFAULT を使用する場合と同じ結果になるとは限りません。ユーザーがマシンのロケール設定をカスタマイズし、LocaleID.DEFAULT を使用するのではなく、明示的なロケール ID 名を要求した場合、アプリケーションがそれらのカスタマイズされた設定を取得しない場合があります。
  3. システムがコンストラクターで指定された requestedLocaleIDName をサポートしていない場合、代替のロケール ID 名が提供されます。



実装
    public function get actualLocaleIDName():String

関連する API エレメント

lastOperationStatus

プロパティ 
lastOperationStatus:String  [読み取り専用]

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

この DateTimeFormatter オブジェクトが実行した前の操作のステータス。コンストラクターまたはこのクラスのメソッドが呼び出されたり、別のプロパティが設定されたりすると、必ず lastOperationStatus プロパティが設定されます。有効な値については、各メソッドの説明を参照してください。



実装
    public function get lastOperationStatus():String

関連する API エレメント

requestedLocaleIDName

プロパティ 
requestedLocaleIDName:String  [読み取り専用]

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

この DateTimeFormatter オブジェクトのコンストラクターに渡された、要求されたロケール ID の名前。

LocaleID.DEFAULT 値が使用された場合、返される名前は「i-default」です。代替のロケールが適用される場合、実際に使用されるロケールは要求されたロケールと異なる場合があります。 実際のロケール名は actualLocaleIDName プロパティを使用して取得できます。



実装
    public function get requestedLocaleIDName():String

関連する API エレメント

コンストラクターの詳細

DateTimeFormatter

()コンストラクター
public function DateTimeFormatter(requestedLocaleIDName:String, dateStyle:String = "long", timeStyle:String = "long")

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

指定されたロケールと提供された日付と時刻フォーマットスタイルの規則に基づいて、日付と時間をフォーマットするための新しい DateTimeFormatter オブジェクトを構築します。日付および時刻スタイルは、日付および時刻フォーマット パターンをオペレーティングシステムによる事前定義のロケールに依存したパターンに設定するために使用されます。

このコンストラクターは、現在のオペレーティングシステムが要求されたロケール ID 名をサポートしているかどうかを判別します。サポートされていない場合、代わりに代替のロケールが使用されます。代替のロケール ID の名前は、actualLocaleIDName プロパティから決めることができます。

requestedLocaleIDNamedateStyle または timeStyle パラメーターのいずれかに代替のパラメーターが使用されると、代替の種類を示すために lastOperationStatus プロパティが設定されます。

ユーザーの現在のオペレーティングシステムの環境設定に基づいてフォーマットするには、requestedLocaleIDName パラメーターの値 LocaleID.DEFAULT をコンストラクターに渡します。

コンストラクターが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

要求されたロケール ID 名を使用できない場合、lastOperationStatus は以下のいずれかに設定されます。

  • LastOperationStatus.USING_FALLBACK_WARNING
  • LastOperationStatus.USING_DEFAULT_WARNING

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

上記の警告および lastOperationStatus プロパティのその他の有効な値について詳しくは、LastOperationStatus クラスの説明を参照してください。

パラメーター
requestedLocaleIDName:String — 日付または時刻フォーマットを決めるときに使用する優先ロケール ID 名。
 
dateStyle:String (default = "long") — 日付をフォーマットするときに使用するスタイルを指定します。この値は、DateTimeStyle クラスによって列挙される値のいずれかに対応します。
  • DateTimeStyle.LONG
  • DateTimeStyle.MEDIUM
  • DateTimeStyle.SHORT
  • DateTimeStyle.NONE
 
timeStyle:String (default = "long") — 時間をフォーマットするときに使用するスタイルを指定します。この値は、DateTimeStyle クラスによって列挙される値のいずれかに対応します。
  • DateTimeStyle.LONG
  • DateTimeStyle.MEDIUM
  • DateTimeStyle.SHORT
  • DateTimeStyle.NONE

例外
ArgumentError dateStyle または timeStyle パラメーターが有効な DateTimeStyle 定数でない場合。
 
TypeError dateStyle または timeStyle パラメーターが null の場合。

関連する API エレメント

メソッドの詳細

format

()メソッド
public function format(dateTime:Date):String

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

ユーザーのローカル時間として解釈される(date、day、fullYear、hours、minutes、month および seconds などの Date オブジェクトのローカル時間コンポーネントを使用)Date オブジェクトの表示文字列をフォーマットします。フォーマットは、この DateTimeFormatter インスタンスに指定されたロケール ID と日付スタイルおよび時刻スタイル、またはカスタマイズされた日付パターンと時刻パターンの規則を使用して行われます。

このメソッドが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

パラメーター

dateTime:Date — フォーマットされる Date 値。 有効な値の範囲は、Jan 1, 1601~Dec 31, 30827 です。

戻り値
String — 日付または時間の値を表すフォーマットされた文字列。

関連する API エレメント

formatUTC

()メソッド 
public function formatUTC(dateTime:Date):String

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

UTC 時間として解釈される(dateUTC、dayUTC、fullYearUTC、hoursUTC、minutesUTC、monthUTC および secondsUTC などの Date オブジェクトの UTC コンポーネントを使用)Date オブジェクトの表示文字列を dateStyle、timeStyle 、または日付時刻パターンに基づいてフォーマットします。フォーマットは、この DateTimeFormatter インスタンスに指定されたロケール ID と日付スタイルおよび時刻スタイル、またはカスタマイズされた日付パターンと時刻パターンの規則を使用して行われます。

このメソッドが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

パラメーター

dateTime:Date — フォーマットされる Date 値。 有効な値の範囲は、Jan 1, 1601~Dec 31, 30827 です。

戻り値
String — 日付または時間の値を表すフォーマットされた文字列。

関連する API エレメント

getAvailableLocaleIDNames

()メソッド 
public static function getAvailableLocaleIDNames():Vector.<String>

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

このクラスでサポートされているすべてのロケール ID 名のリストが表示されます。

このクラスが現在のオペレーティングシステムでサポートされていない場合、このメソッドは null 値を返します。

このメソッドが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

戻り値
Vector.<String> — このクラスでサポートされているすべてのロケール ID 名を含む文字列のベクトル。

関連する API エレメント

getDateStyle

()メソッド 
public function getDateStyle():String

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

DateTimeFormatter のこのインスタンスの日付スタイルを取得します。 この日付スタイルは、オペレーティングシステムから事前定義の日付フォーマットパターンを取得するために使用されます。 日付スタイルの値は、DateTimeFormatter() コンストラクター、setDateTimeStyles() メソッドまたは setDateTimePattern() メソッドによって設定できます。

このメソッドが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

戻り値
String — このフォーマッターの日付スタイル文字列。

有効な値:

  • DateTimeStyle.LONG
  • DateTimeStyle.MEDIUM
  • DateTimeStyle.SHORT
  • DateTimeStyle.NONE
  • DateTimeStyle.CUSTOM

関連する API エレメント

getDateTimePattern

()メソッド 
public function getDateTimePattern():String

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

この DateTimeFormatter オブジェクトによって日付と時間をフォーマットするために使用されるパターン文字列を返します。

このパターンは次の 3 つの方法のいずれかで設定できます。

  1. コンストラクターで使用されている dateStyle および timeStyle パラメーターによる方法
  2. setDateTimeStyles() メソッドによる方法
  3. setDateTimePattern() メソッドによる方法

パターンシンタックスについて詳しくは、「setDateTimePattern() メソッド」を参照してください。

このメソッドが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

戻り値
String — この DateTimeFormatter オブジェクトによって日付と時間をフォーマットするために使用されるパターンを含む文字列。

関連する API エレメント

getFirstWeekday

()メソッド 
public function getFirstWeekday():int

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

このロケールおよびカレンダーシステムの週の最初の日に対応する整数を返します。値 0 は日曜日、1 は月曜日というように対応し、6 が土曜日に対応します。

このメソッドが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

戻り値
int — このロケールおよびカレンダーシステムの週の最初の日に対応する整数。

関連する API エレメント

getMonthNames

()メソッド 
public function getMonthNames(nameStyle:String = "full", context:String = "standalone"):Vector.<String>

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

現在のカレンダーシステムの月の名前を含むローカライズされた文字列のリストを取得します。このリストの最初の要素は、年の最初の月の名前です。

このメソッドが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

パラメーター

nameStyle:String (default = "full") — 使用される名前文字列のスタイルを示します。有効な値は次のとおりです。
  • DateTimeNameStyle.FULL
  • DateTimeNameStyle.LONG_ABBREVIATION
  • DateTimeNameStyle.SHORT_ABBREVIATION
 
context:String (default = "standalone") — フォーマットされたストリングが使用されるコンテキストを示すコード。このコンテキストは、特定のロケールについてのみ影響を及ぼします。有効な値は次のとおりです。
  • DateTimeNameContext.FORMAT
  • DateTimeNameContext.STANDALONE

戻り値
Vector.<String> — 指定されたロケール、名前スタイルおよびコンテキストの月の名前を含むローカライズされたストリングのベクトル。このベクトルのインデックス 0 における最初の要素は年の最初の月の名前、次の要素は年の 2 番目の月の名前というように続きます。

例外
TypeError nameStyle または context パラメータが null の場合。

関連する API エレメント

getTimeStyle

()メソッド 
public function getTimeStyle():String

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

DateTimeFormatter のこのインスタンスの時間スタイルを取得します。この時間スタイルは、オペレーティングシステムから事前定義の時間フォーマットパターンを取得するために使用されます。 時間スタイルの値は、DateTimeFormatter() コンストラクター、setDateTimeStyles() メソッドまたは setDateTimePattern() メソッドによって設定できます。

このメソッドが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

戻り値
String — このフォーマッターの時間スタイル文字列。

有効な値:

  • DateTimeStyle.LONG
  • DateTimeStyle.MEDIUM
  • DateTimeStyle.SHORT
  • DateTimeStyle.NONE
  • DateTimeStyle.CUSTOM

関連する API エレメント

getWeekdayNames

()メソッド 
public function getWeekdayNames(nameStyle:String = "full", context:String = "standalone"):Vector.<String>

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

現在のカレンダーシステムの曜日の名前を含むローカライズされた文字列のリストを取得します。リストの最初の要素は、日曜日の名前を表しています。

このメソッドが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

パラメーター

nameStyle:String (default = "full") — 使用される名前文字列のスタイルを示します。有効な値は次のとおりです。
  • DateTimeNameStyle.FULL
  • DateTimeNameStyle.LONG_ABBREVIATION
  • DateTimeNameStyle.SHORT_ABBREVIATION
 
context:String (default = "standalone") — フォーマットされたストリングが使用されるコンテキストを示すコード。このコンテキストは、コンテキストに応じて月の名前表示が変わる特定のロケールにのみ適用されます。例えば、ギリシャ語では、月の名前だけを表示する場合と、月と日にちを表示する場合では、月名の表示が異なります。有効な値は次のとおりです。
  • DateTimeNameContext.FORMAT
  • DateTimeNameContext.STANDALONE

戻り値
Vector.<String> — 指定されたロケール、名前スタイルおよびコンテキストの月の名前を含むローカライズされたストリングのベクトル。このベクトルのインデックス 0 における最初の要素は日曜日の名前、次の要素は月曜日の名前というように続きます。

例外
TypeError nameStyle または context パラメータが null の場合。

関連する API エレメント

setDateTimePattern

()メソッド 
public function setDateTimePattern(pattern:String):void

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

この DateTimeFormatter オブジェクトで日付と時間をフォーマットするために使用するパターン文字列を設定します。

日付をフォーマットするために使用されるパターンは次の 3 つの方法のいずれかで設定できます。

  1. コンストラクターで使用されている dateStyle および timeStyle パラメーターによる方法
  2. setDateTimeStyles() メソッドによる方法
  3. setDateTimePattern() メソッドによる方法

このメソッドの副作用として、この DateTimeFormatter オブジェクトの現在の時間および日付スタイルが無効になり、値 DateTimeStyle.CUSTOM に設定されます。

パターンストリングにより、日付と時間をフォーマットする方法が定義されます。パターンには、フォーマットされたストリングで日付および時間の値に置き換えられる文字シーケンスが含まれます。例えば、「yyyy/MM」というパターンでは、「yyyy」という文字列が 4 桁の年に置き換えられ、その後に「/」が続き、「MM」という文字列が 2 桁の月に置き換えられます。

パターンで使用される文字の多くは、以下の表に示したように、2 回以上繰り返し使用して、様々な出力を生み出すことができます。

シーケンスがパターンでサポートされている文字の最大数を超えると、そのパターン文字でサポートされている最も長いシーケンスに戻って割り当てられます。次に実際の使用例を示します。

  • MMMMMM は MMMM に置き換えられます
  • dddd は dd に置き換えられます
  • EEEEEEE は EEEE に置き換えられます
  • aa は a に置き換えられます
  • hhh は hh に置き換えられます
  • mmmm は mm に置き換えられます

理論的には、パターンには最大 255 文字まで含むことができますが、さらに制限の厳しいプラットフォームもあります。パターンがパターン文字数制限を超えると、lastOperationStatus プロパティは値 LastOperationStatus.PATTERN_SYNTAX_ERROR に設定されます。

各オペレーティングシステムで有効なパターンがすべてサポートされているわけではありません。パターンがプラットフォームでサポートされていない場合、代替パターンが使用され、代替パターンが使用されていることを示すように lastOperationStatus プロパティが設定されます。適切な代替パターンを使用できない場合、空のストリングが使用され、パターンがサポートされていないことを示すように lastOperationStatus プロパティが設定されます。

次の表は有効なパターン文字とその意味を示しています。

パターン文字説明
G紀元です。現在の日付およびカレンダーの紀元文字列に置き換えられます。このパターンは、すべてのオペレーティングシステムでサポートされているわけではありません。紀元をサポートしないオペレーティングシステムでは、入力パターンの文字が空のストリングに置き換えられます。

次のように解釈される紀元のパターンには 1~5 文字を含むことができます。

  • パターン文字の数が 1~3 文字の場合、短縮形が使用されます。
  • パターン文字の数が 4 つの場合、形式は省略形でない形式として解釈されます。
  • パターン文字の数が 5 つの場合、形式は短い省略形として解釈されます。

グレゴリオ暦の例(このパターンをサポートするオペレーティングシステム):

  • G、GG、GGG = AD
  • GGGG = Anno Domini
  • GGGGG = A
y年です。パターン文字の数が 2 の場合、年の最後の 2 桁が表示され、それ以外の場合、桁数は文字数によって決まります。年の値に文字数によって提供されるよりも多くの桁数が必要な場合、省略形でない年の値が提供されます。 値によって要求されるよりも多くの文字がある場合、年の値はゼロで桁揃えされます。次のリストは、1 および 2005 年の結果を示しています。

例:

  • y = 1
  • y = 2005
  • yy = 01
  • yy = 05
  • yyyy = 0001 または 01 (オペレーティングシステムによって変わります)。
  • yyyy = 2005
  • yyyyy = 01 または 0001 (オペレーティングシステムによって変わります)。y が 4 を超える場合、オペレーティングシステムでサポートされている最大桁数に置き換えられます。
  • yyyyy = 2005
M 月です。 次のように解釈される月のパターンには 1~5 文字を含めることができます。
  • パターン文字の数が 1 つの場合、形式は 1 桁または 2 桁の数値として解釈されます。
  • パターン文字の数が 2 つの場合、形式は 2 桁の数値として解釈されます。
  • パターン文字の数が 3 つの場合、形式は長い省略形として解釈されます。
  • パターン文字の数が 4 つの場合、形式は省略形でない名前として解釈されます。
  • パターン文字の数が 5 つの場合、形式は短い省略形として解釈されます。この形式は、すべてのオペレーティングシステムでサポートされているわけではなく、長い省略形に置き換えられます。

例:

  • M = 7
  • MM = 07
  • MMM = Jul、7月
  • MMMM = July、7月
  • MMMMM = J または Jul、7 または 7月 (オペレーティングシステムによって変わります)。
d 日です。次のように解釈される月のパターンには 1~2 文字を含めることができます。
  • パターン文字の数が 1 つの場合、形式は 1 桁または 2 桁の数値として解釈されます。
  • パターン文字の数が 2 つの場合、形式は 2 桁の数値として解釈されます。

例:

  • d = 4
  • dd = 04
  • dd = 14
E曜日です。 次のように解釈される曜日のパターンには 1~5 文字を含めることができます。
  • パターン文字の数が 1~3 の場合、形式は長い省略形として解釈されます。
  • パターン文字の数が 4 つの場合、形式は省略形でない名前として解釈されます。
  • パターン文字の数が 5 つの場合、形式は短い省略形として解釈されます。この形式は、すべてのオペレーティングシステムでサポートされているわけではなく、長い省略形に置き換えられます。

例:

  • E、EE、EEE = Tues
  • EEEE = Tuesday
  • EEEEE = T または Tues (オペレーティングシステムによって変わります)。
Q四半期です。プラットフォームの中には、このパターンをサポートしていないものがあります。次のように解釈される四半期のパターンには 1~4 文字を含めることができます。
  • パターン文字の数が 1 つの場合、形式は 1 桁の数値として解釈されます。
  • パターン文字の数が 2 つの場合、形式は 2 桁の数値として解釈されます。
  • パターン文字の数が 3 つの場合、形式は省略形として解釈されます。
  • パターン文字の数が 4 つの場合、形式は省略形でない名前として解釈されます。

例(このパターンをサポートするオペレーティングシステムの場合):

  • Q = 2
  • QQ = 02
  • QQQ = Q2
  • QQQQ = 第 2 四半期
w年間通算週です。プラットフォームの中には、このパターンをサポートしていないものがあります。次のように解釈されるこのパターンには 1~2 文字を含めることができます。
  • パターン文字の数が 1 つの場合、形式は 1 桁または 2 桁の数値として解釈されます。
  • パターン文字の数が 2 つの場合、形式は 2 桁の数値として解釈されます。

年間第 2 週の例(このパターンをサポートするオペレーティングシステムの場合):

  • w = 2
  • ww = 02
W月間通算週です。プラットフォームの中には、このパターンをサポートしていないものがあります。このパターンで使用できるのは 1 文字のみです。

7 月第 2 週の例(このパターンをサポートするオペレーティングシステムの場合):

  • W = 2
D年間通算日です。プラットフォームの中には、このパターンをサポートしていないものがあります。このパターンで使用できるのは 1~3 文字です。

年間 2 日目の例(このパターンをサポートするオペレーティングシステムの場合):

  • D = 2
  • DD = 02
  • DDD = 002
Fカレンダー月内の曜日の位置です。例えば、この要素を使用して、10 月の第 3 月曜日の日付をフォーマットする場合は「3」と表示されます。このパターンで使用できるのは 1 文字のみです。

7 月第 2 水曜日の例(このパターンをサポートするオペレーティングシステムの場合):

  • F = 2
a午前 / 午後を表します。このパターンで使用できるのは、a か p の一文字だけです。

例:

  • a = AM, 午前
  • p = PM, 午後
h12 時間形式の時間(1~12)です。 このパターンは 1~2 文字になります。

例:

  • h = 1
  • h = 12
  • hh = 01
H24 時間形式の時間(0~23)です。 このパターンは 1~2 文字になります。

例:

  • H = 0
  • H = 23
  • HH = 00
K12 時間形式の時間(0~11)です。 このパターンは 1~2 文字になります。このパターンは、すべてのオペレーティングシステムでサポートされているわけではありません。

例(このパターンをサポートするオペレーティングシステムの場合):

  • K = 0
  • K = 11
  • KK = 00
k24 時間形式の時間(1~24)です。 このパターンは 1~2 文字になります。このパターンは、すべてのオペレーティングシステムでサポートされているわけではありません。

例(このパターンをサポートするオペレーティングシステムの場合):

  • k = 1
  • k = 24
  • kk = 01
m1 時間内の分(0~59)です。このパターンは 1~2 文字になります。

例:

  • m = 2
  • m = 59
  • mm = 02
s1 分内の秒(0~59)です。このパターンは 1~2 文字になります。

例:

  • s = 2
  • s = 59
  • ss = 02
Sミリ秒です。このパターンは 1~5 文字になります。この値は、使用される文字数に従って丸められます。5 文字(SSSSS)を使用すると、少数桁のミリ秒を表します。

例:

  • S = 2
  • SS = 24
  • SSS = 235
  • SSSS = 2350
  • SSSSS = 23500
zタイムゾーンです。タイムゾーンを、特定の場所を参照することなく、標準時または夏時間を参照する文字列として表示します。このパターンは、すべてのオペレーティングシステムでサポートされているわけではありません。タイムゾーンパターンをサポートしないオペレーティングシステムでは、入力パターンの文字列は空のストリングに置き換えられます。このパターンをサポートするオペレーティングシステムでは、すべてのロケールに定義されたストリングがあるわけではありません。それらのロケールは、GMT-08:00 や GW-08:00 などの GMT フォーマットに置き換えられます。

このタイムゾーンのパターンでは 1~4 文字を使用し、次のように解釈されます。

  • パターン文字の数が 1~3 の場合、形式は省略形として解釈されます。
  • パターン文字の数が 4 つの場合、形式は省略形でない名前として解釈されます。

この形式をサポートするオペレーティングシステムの例:

  • z、zz、zzz = PDT
  • z、zz、zzz = PST
  • z、zz、zzz = GMT-0800
  • zzzz = 太平洋夏時間
  • zzzz = 太平洋標準時
Zタイムゾーンです。タイムゾーンを GMT からのオフセットとして表します。 このパターンは、すべてのオペレーティングシステムでサポートされているわけではありません。タイムゾーンパターンをサポートしないオペレーティングシステムでは、入力パターンの文字列は空のストリングに置き換えられます。

このタイムゾーンのパターンでは 1~4 文字を使用し、次のように解釈されます。

  • パターン文字の数が 1~3 の場合、形式は RFC 822 フォーマットを使用します。
  • パターン文字の数が 4 つの場合、形式はローカライズされた GMT フォーマットを使用します。ローカライズされた GMT フォーマットのないロケールの場合、これはローカライズされていない GMT フォーマットに置き換えられます。

この形式をサポートするオペレーティングシステムの例:

  • Z、ZZ、ZZZ = -0800
  • ZZZZ = GMT-08:00、GW-08:00
vタイムゾーンです。特定の場所を参照したり、夏時間と標準時間とを区別したりしない汎用タイムゾーンを反映する文字列です。このパターンは、すべてのオペレーティングシステムでサポートされているわけではありません。タイムゾーンパターンをサポートしないオペレーティングシステムでは、入力パターンの文字列は空のストリングに置き換えられます。このパターンをサポートするオペレーティングシステムでは、ローカライズされた名前を使用できない場合、代替のストリングが提供されます。

このタイムゾーンのパターンでは 1~4 文字を使用し、次のように解釈されます。

  • パターン文字の数が 1 つの場合、形式は省略形を使用します。
  • パターン文字の数が 4 つの場合、形式は省略形でない形式を使用します。

この形式をサポートするオペレーティングシステムの例:

  • v = PT
  • vvvv = 太平洋標準時
'その他のテキスト'パターン文字列には、テキストおよび句読点が含まれる場合があります。ただし、a~z および A~Z の文字は構文文字として予約され、フォーマットされた文字列に含めるために一重引用符で囲む必要があります。結果文字列に一重引用符を含めるには、パターン文字列に 2 つの一重引用符を含める必要があります。2 つの一重引用符をパターンストリングの引用された部分の内側または外側に表示できます。一重引用符のペアが対応しない場合、ストリングの最後で終了します。

例:

  • EEEE, MMM. d, yyyy 'at' h 'o''clock' a= Tuesday, Sept. 8, 2005 at 1 o'clock PM
  • yyyy年M月d日 = 2005年9月8日
  • mm''ss'' = 43'01'

このメソッドが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

パラメーター

pattern:String


例外
TypeError — パターンパラメーターが null の場合。

関連する API エレメント

setDateTimeStyles

()メソッド 
public function setDateTimeStyles(dateStyle:String, timeStyle:String):void

言語バージョン: ActionScript 3.0
ランタイムバージョン: Flash Player 10.1, AIR 2

DateTimeFormatter のこのインスタンスの日付および時刻スタイルを設定します。日付および時刻スタイルは、日付および時刻フォーマット パターンをオペレーティングシステムによる事前定義のロケールに依存したパターンに設定するために使用されます。このメソッドにより、DateTimeFormatter() コンストラクターまたは setDateTimePattern() メソッドを使用して設定されたスタイルが置き換えられます。日付および時刻パターンは設定されたスタイルによっても更新されます。

このメソッドが呼び出されて正しく完了すると、lastOperationStatus プロパティが次のように設定されます。

  • LastOperationStatus.NO_ERROR

それ以外の場合、lastOperationStatus プロパティは LastOperationStatus クラスで定義された定数のいずれかに設定されます。

パラメーター

dateStyle:String — 日付をフォーマットするときに使用するスタイルを指定します。この値は、DateTimeStyle クラスによって列挙される値のいずれかに対応します。
  • DateTimeStyle.LONG
  • DateTimeStyle.MEDIUM
  • DateTimeStyle.SHORT
  • DateTimeStyle.NONE
 
timeStyle:String — 時間をフォーマットするときに使用するスタイルを指定します。この値は、DateTimeStyle クラスによって列挙される値のいずれかに対応します。
  • DateTimeStyle.LONG
  • DateTimeStyle.MEDIUM
  • DateTimeStyle.SHORT
  • DateTimeStyle.NONE


例外
ArgumentError dateStyle または timeStyle パラメーターが有効な DateTimeStyle 定数でない場合。
 
TypeError dateStyle または timeStyle パラメーターが null の場合。

関連する API エレメント

DateTimeFormatter.1.as

次の例は、日付と時刻の値を表すストリングが、ロケールごとにどのようにフォーマットされるかを示します。この例の結果は、オペレーティングシステムやユーザー環境設定によって異なる場合があります。

この例では、英語(米国)、フランス語(フランス)、スペイン語(スペイン)のロケールを使用しています。

この例では、リストの各ロケールに対して、次の処理を行います。

  1. デフォルトのスタイル(長い dateStyle、長い timeStyle)を使用して DateTimeFormatter オブジェクトを作成します。
  2. デフォルトの長い日付スタイルを使用して現在の日付と時刻をフォーマットします。
  3. DateTimeStyle.NONE 定数および DateTimeStyle.SHORT 定数を使用して、時刻のみの短い日付スタイルに変更します。
  4. 時刻のみの短い日付スタイルを使用して現在の日付と時刻をフォーマットします。
package {
    import flash.display.Sprite;
    import flash.globalization.DateTimeFormatter;
    import flash.globalization.DateTimeStyle;
    
    public class DateTimeFormatterExample extends Sprite
    {    
        private var localeList:Array = new Array("en-US", "fr-FR", "es-ES");
    
        public function DateTimeFormatterExample()
        {
            var date:Date = new Date();
            
            for each (var locale:String in localeList) {
                var dtf:DateTimeFormatter = new DateTimeFormatter(locale);
                trace('\n' + "LocaleID requested=" + dtf.requestedLocaleIDName 
                    + "; actual=" + dtf.actualLocaleIDName);
            
                var longDate:String = dtf.format(date);
                trace(longDate + " (" + dtf.getDateTimePattern() + ")");
            
                dtf.setDateTimeStyles(DateTimeStyle.NONE, DateTimeStyle.SHORT);
                var shortDate:String = dtf.format(date);
                trace(shortDate + " (" + dtf.getDateTimePattern() + ")");
            }        
        }
    }
}
DateTimeFormatter.2.as

次の例は、ユーザーによって選択されたパターンに基づいて、アプリケーションが日付をフォーマットする方法を示します。この例の結果は、オペレーティングシステムやユーザー環境設定によって異なる場合があります。

この例では、リストの各ロケールに対して、次の処理を行います。

  1. 入出力用のテキストフィールドを 3 つ作成します。
  2. 英語(米国)ロケールを使用して DateTimeFormatter オブジェクトを作成します。
  3. configureTextField() 関数を呼び出します。この関数はテキストフィールドの位置とサイズを設定し、patternField オブジェクトにイベントリスナーを追加します。
  4. ユーザーが patternField テキストフィールドにパターンを入力すると、そのパターンを使用して textInputHandler 関数が現在の日付と時刻をフォーマットし、その結果と lastOperationStatus 値を出力テキストフィールドに表示します。
 
package {  
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.globalization.DateTimeFormatter;
    import flash.text.*;
    
    public class DateTimePatternExample extends Sprite
    {    
        private var patternField:TextField = new TextField();
        private var resultField:TextField = new TextField();
        private var statusField:TextField = new TextField();
           private var date:Date = new Date();
         private var dtf:DateTimeFormatter = new DateTimeFormatter("en-US");           
         
        private function configureTextField():void
        {
            patternField.type = TextFieldType.INPUT;
            patternField.width = 300;
            patternField.height = 20;
            patternField.background = true;
            patternField.border = true;
            
            resultField.y = 40;
            resultField.width = 300;
            resultField.height = 20;
            
            statusField.y = 80;
            statusField.width = 300;
            statusField.height = 20;

            addChild(patternField);
            addChild(resultField);
            addChild(statusField);
            patternField.addEventListener(Event.CHANGE,textInputHandler);
        }

        private function textInputHandler(event:Event):void
        {                 
            dtf.setDateTimePattern(patternField.text);
            statusField.text = dtf.lastOperationStatus;
            resultField.text = dtf.format(date);
        }

        public function DateTimePatternExample()
        {
            configureTextField();    
        }
    }
}




[ X ]英語で表示される理由
ActionScript 3.0 リファレンスガイドのコンテンツが英語で表示されます。

ActionScript 3.0 リファレンスガイドのすべての部分がすべての言語に翻訳されているわけではありません。言語エレメントが翻訳されていない場合、そのエレメントは英語で表示されます。例えば、ga.controls.HelpBox クラスはどの言語にも訳されていません。このため、リファレンスガイドの日本語バージョンでは、ga.controls.HelpBox クラスは英語で表示されます。